package feeinterface.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;

import com.ulwx.tool.DbUtils;
import com.ulwx.tool.StringUtils;

import feeinterface.modeldb.BaseBlackCollectList;

public class BaseBlackCollectListDao {
	private static final Logger log = Logger
			.getLogger(BaseBlackCollectListDao.class);
	public static boolean isBlackList(String IMSI) {
		// DataBase db = DataBaseFactory.getDataBase();
		Map<Integer, Object> map = new HashMap<Integer, Object>();
		String sql = "";
		// boolean dbReconnect = false;
		if (StringUtils.hasText(IMSI)) {
			sql = "SELECT * FROM BaseBlackCollectList WHERE IMSI = ?";
			map.put(1, IMSI);
			try {
				List<BaseBlackCollectList> list = DbUtils.doQueryClass(null,
						BaseBlackCollectList.class, sql, map);
				if (list != null && list.size() >= 1) {
					return true;
				}
			} catch (Exception e) {
				log.error("",e);
				return false;
			}

		}
		return false;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.println(isBlackList("460022738095668"));

	}

}
